from ptk.fun import *
from ctypes import *

class Mdl_:
    pmdl = c_void_p()

    def __init__(self,p):
       self.pmdl = p 

    @property
    def name(self):
        return MdlNameGet(self.pmdl)

    @name.setter
    def name(self,name):
        return MdlRename(self.pmdl,name)

    def Display(self):
        return MdlDisplay(self.pmdl)

class Solid(Mdl_):
    def DeleteFeature(self,feats,opts):
        FeatureDelete(self.pmdl,feats,opts)

class Assembly(Solid):
    def Assemble(self,component_model,init_pos):
        return Asmcomp(AsmcompAssemble(self.pmdl,component_model.pmdl,init_pos))

class Part(Solid):
    pass

class Asmcomp:
    item = None
    def __init__(self,Modelitemstruct):
       self.item = Modelitemstruct

    def PositionSet(self,component_path,position):
        AsmcompPositionSet(component_path,self.item,position)

    def PositionGet(self):
        return AsmcompPositionGet(self.item)
        
